#include <iostream>
#include <ctime>
using namespace std;

float 

int fibo(int n){
  if(n < 2){
    return 1;
  }
  else{
    return fibo(n-1)+fibo(n-2);
  }
}

int fiboIter(int n){
  int res = 0;  int n_1 = 1;  int n_2 = 1;  int i = 1;
  while (i<n){
    res = n_1 + n_2;
    n_2 =n_1;
    n_1 = res;
    i++;
  }
  return res;
}

int main(){
  double t1,t2,t3,t4;
  for (int i=0; i<10000; i++){
    t1 =clock();
    cout<<"Fibo("<<i<<") = "<<fibo(i)<<endl;
    t2 =clock();
    cout<<"time: "<< (t2-t1)/CLOCKS_PER_SEC <<endl;
    
    t3 =clock();
    cout<<"FiboIter("<<i<<") = "<<fiboIter(i)<<endl;
    t4 =clock();
    cout<<"time: "<< (t4-t3)/CLOCKS_PER_SEC <<endl; 
  }
return 0;
}
